<template>
  <el-main style=" width:100%; padding:15px 35px">
    <el-form label-width="120px">
      <el-row>
        <!-- 课程名称 -->
        <el-col :span="24">
          <el-form-item label="课程名称" label-width="95px">
            <el-input
              v-model="courseData.title"
              :readonly="true"
              size="small"
              class
            />
          </el-form-item>
        </el-col>
        <!-- 课程类别 -->
        <el-col :span="24" style="margin-top:25px">
          <el-form-item label="课程类别" label-width="95px">
            <el-input
              v-model="courseData.courseTypeName"
              size="small"
              :readonly="true"
            />
          </el-form-item>
        </el-col>
        <!-- 年份 -->
        <el-col :span="12" style="margin-top:25px">
          <el-form-item label="年份" label-width="95px">
            <el-input
              v-model="courseData.year"
              :readonly="true"
              size="small"
              class
            />
          </el-form-item>
        </el-col>
        <!-- 学期 -->
        <el-col :span="12" style="margin-top:25px">
          <el-form-item
            label="学期"
            label-width="70px"
            style="margin-left:25px"
          >
            <el-input v-model="courseData.term" size="small" :readonly="true" />
          </el-form-item>
        </el-col>
        <!-- 总学时 -->
        <el-col :span="12" style="margin-top:25px">
          <el-form-item label="总学时" label-width="95px">
            <el-input
              v-model="courseData.classHours"
              :readonly="true"
              size="small"
              class
            />
          </el-form-item>
        </el-col>
        <!-- 总学分 -->
        <el-col :span="12" style="margin-top:25px">
          <el-form-item
            label="总学分"
            label-width="70px"
            style="margin-left:25px"
          >
            <el-input
              v-model="courseData.credits"
              size="small"
              :readonly="true"
            />
          </el-form-item>
        </el-col>
        <!-- 上课时间和地方 -->
        <el-col :span="24" style="margin-top:25px">
          <el-form-item label="上课时间与地点">
            <el-table
              class="courseData"
              :data="courseData.timePlace"
              border
              style="width: 100%"
              :header-cell-style="{
                background: '#94AFCC',
                color: '#1A1C1E',
                padding: '0',
                height: '10px',
              }"
              :row-style="{ height: '10px', padding: '0px' }"
              :cell-style="{ padding: '0px' }"
              resize="none"
            >
              <el-table-column prop="time" label="时间" :resizable="false"></el-table-column>
              <el-table-column prop="buildingId" label="楼栋" :resizable="false"></el-table-column>
              <el-table-column prop="roomNumber" label="课室" :resizable="false"></el-table-column>
            </el-table>
          </el-form-item>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row style="margin-top:20px">
        <el-col :span="24">
          <div style="font-size:17px;color:rgb(12, 76, 142);">任教教师信息</div>
        </el-col>
        <!-- 老师姓名 -->
        <el-col :span="24" style="margin-top:15px">
          <el-form-item label="姓名" label-width="95px">
            <el-input
              v-model="courseData.name"
              :readonly="true"
              size="small"
              class
            />
          </el-form-item>
        </el-col>
        <!-- 所属学院 -->
        <el-col :span="24" style="margin-top:25px">
          <el-form-item label="所属学院" label-width="95px">
            <el-input
              v-model="courseData.departmentName"
              :readonly="true"
              size="small"
              class
            />
          </el-form-item>
        </el-col>
        <!-- 职称 -->
        <el-col :span="24" style="margin-top:25px">
          <el-form-item label="职称" label-width="95px">
            <el-input
              v-model="courseData.academicTitle"
              :readonly="true"
              size="small"
              class
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </el-main>
</template>

<script>
export default {
  data() {
    return {
      courseData: {
        title: "软件项目管理",
        courseTypeName: "专业必修课",
        year: "2019",
        term: "上学期",
        classHours: 64,
        credits: 3.5,
        Teacher: null,
        timePlace: [
          {
            time: "星期二 1-3节",
            buildingId: "A1",
            roomNumber: "101",
          },
          {
            time: "星期三 2-4节",
            buildingId: "A2",
            roomNumber: "103",
          },
        ],
        name: "李红",
        departmentName: "软件学院",
        academicTitle: "副教授",
      },
    };
  },
  methods: {
    //返回课程具体信息
    returnCourseDetail() {
      let options = { sections: this.$store.state.temp_courseSections };
      this.$http
        .post(this.$api.CourseMonitorGETCourseOfS, options)
        .then((resp) => {
          if (resp.success) {
            this.courseData = resp.data;
          } else {
            this.$handleFailResp(this, resp);
          }
        });
    },
  },
  mounted(){
    this.returnCourseDetail()
  }
};
</script>

<style lang="less" scoped>
.el-input {
  width: 150px;
}

/deep/ .el-input.is-disabled .el-input__inner {
  color: black;
  border: 1px solid #8595a6;
  border-radius: 1px;
  //background-color: #edeff1;
  padding: 5px;
}

/deep/ .el-input__inner {
  color: black;
  border: 1px solid #8595a6;
  border-radius: 1px;
  //background-color: #fff;
  padding: 5px;
}

/deep/ .el-form-item__label {
  margin-right: 0px;
  text-align: left;
  color: #333333;
}

/deep/.el-input--small .el-input__inner {
  height: 25px;
}

.el-form-item {
  margin-bottom: 0px;
}

/deep/ .el-form-item__content {
  padding: 0;
}

.courseData {
  margin-top: 10px;
  width: 450px !important;
}

// 弹窗的样式
/deep/ .el-dialog__title {
  font-size: 23px;
  color: rgb(51, 55, 68);
}

.el-divider--horizontal {
  margin: auto;
  width: 95%;
  height: 2px;
  margin-top: 20px;
}
</style>
